<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="utf-8">
    <title>SAAS云管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <link rel="icon" href="${site.logo}">
    <link rel="stylesheet" th:href="@{/static/layui/css/layui.css}" media="all"/>
    <link rel="stylesheet" href="//at.alicdn.com/t/font_tnyc012u2rlwstt9.css" media="all"/>
    <link rel="stylesheet" th:href="@{/static/admin/css/main.css}" media="all"/>
    <link rel="stylesheet" href="//at.alicdn.com/t/font_974748_wjk5z1f6gsl.css" media="all"/>
    <link rel="stylesheet" th:href="@{/static/fonts/iconfont.css}" media="all"/>
</head>
<body class="main_body">
<div class="layui-layout layui-layout-admin">
    <!-- 顶部 -->
    <div class="layui-header header">
        <div class="layui-main">
            <a href="#" class="logo">SAAS</a>
            <!-- 显示/隐藏菜单 -->
            <a href="javascript:" class="iconfont hideMenu icon-menu1"></a>
            <div class="weather" pc>
                <div id="tp-weather-widget"></div>
                <script>(function (T, h, i, n, k, P, a, g, e) {
                    g = function () {
                        P = h.createElement(i);
                        a = h.getElementsByTagName(i)[0];
                        P.src = k;
                        P.charset = "utf-8";
                        P.async = 1;
                        a.parentNode.insertBefore(P, a)
                    };
                    T["ThinkPageWeatherWidgetObject"] = n;
                    T[n] || (T[n] = function () {
                        (T[n].q = T[n].q || []).push(arguments)
                    });
                    T[n].l = +new Date();
                    if (T.attachEvent) {
                        T.attachEvent("onload", g)
                    } else {
                        T.addEventListener("load", g, false)
                    }
                }(window, document, "script", "tpwidget", "//widget.seniverse.com/widget/chameleon.js"))</script>
                <script>tpwidget("init", {
                    "flavor": "slim",
                    "location": "WM6N2PM3WY2K",
                    "geolocation": "enabled",
                    "language": "zh-chs",
                    "unit": "c",
                    "theme": "black",
                    "container": "tp-weather-widget",
                    "bubble": "enabled",
                    "alarmType": "circle",
                    "color": "#FFFFFF",
                    "uid": "UB67F638DA",
                    "hash": "077f9da097588ad9cdeed2245c571ea2"
                });
                tpwidget("show");</script>
            </div>
            <!-- 顶部右侧菜单 -->
            <ul class="layui-nav top_menu">
                <shiro:user>
                    <li class="layui-nav-item" mobile>
                        <a href="javascript:" class="mobileAddTab" data-url="/admin/system/user/changePwd"><i
                                class="iconfont icon-shezhi1"
                                data-icon="icon-shezhi1"></i><cite>设置</cite></a>
                    </li>
                </shiro:user>
                <li class="layui-nav-item" mobile>
                    <a th:href="@{/systemLogout}" class="signOut"><i class="iconfont icon-loginout"></i> 退出</a>
                </li>
                <li class="layui-nav-item accountCredit" pc>
                    <!-- <a href="javascript:"  class="leftItem"><i
                             class="layui-icon layui-icon-speaker"></i><cite>信誉值</cite><span
                             class="layui-badge" style="font-size: xx-small;"
                             th:text="${currentUser.credit}">1.0</span></a>-->
                    <a href="javascript:" class="leftItem"><cite>信誉值</cite><span
                            class="layui-badge" style="font-size: xx-small;"
                            th:text="${currentUser.credit}">1.0</span></a>
                </li>
                <!--<li class="layui-nav-item" pc style="display: none">
                    <a href="javascript:" data-url="/admin/system/user/list" class="returnEditUser"><i class="layui-icon layui-icon-speaker"></i><cite>我的消息</cite><span
                            class="layui-badge" style="font-size: xx-small;"></span></a>
                </li>-->
                <li class="layui-nav-item" pc style="display: none">
                    <a href="javascript:" data-url="/admin/user/message/list" class="returnMes"><i
                            class="layui-icon layui-icon-speaker"></i><cite>我的消息</cite><span
                            class="layui-badge" style="font-size: xx-small;" th:text="${currentUser.credit}"></span></a>
                </li>
                <li class="layui-nav-item" pc>
                    <!--   <a href="javascript:" data-url="/admin/user/message/list" class="getMessage"><i class="layui-icon layui-icon-speaker"></i><cite
                               style="display:none;">我的消息</cite><span
                               class="layui-badge" style="font-size: xx-small;" th:text="${messageListCount}">0</span></a>-->
                    <a href="javascript:" class="getMessage"><i class="layui-icon layui-icon-speaker"></i><cite
                            style="display:none;">我的消息</cite><span
                            class="layui-badge" style="font-size: xx-small;" th:text="${messageListCount}"></span></a>
                </li>
                <li class="layui-nav-item rightItem" style="width: 160px" pc>

                    <a href="javascript:">

                        <img th:src="${session.icon}" class="layui-circle" width="35" height="35">
                        <cite>
                            <shiro:principal property="nickName"/>
                        </cite>
                        <span class="layui-nav-more"></span>
                    </a>

                    <dl class="layui-nav-child">
                        <shiro:user>
                            <dd><a href="javascript:" data-url="/admin/system/user/userinfo"><i
                                    class="iconfont icon-zhanghu"
                                    data-icon="icon-zhanghu"></i><cite>个人资料</cite></a>
                            </dd>
                            <dd><a href="javascript:" data-url="/admin/system/user/changePassword"><i class="iconfont icon-shezhi1"
                                                                                                      data-icon="icon-shezhi1"></i><cite>修改密码</cite></a>
                            </dd>

                            <!--<dd><a href="javascript:" data-url="/admin/system/user/changePassword"><i class="iconfont icon-shezhi1" data-icon="icon-shezhi1"></i><cite>属性修改</cite></a></dd>-->
                            <dd><a href="javascript:" data-url="/admin/system/user/changeProperties"><i
                                    class="iconfont icon-shezhi1"
                                    data-icon="icon-shezhi1"></i><cite>查看属性</cite></a>
                            </dd>
                        </shiro:user>
                        <dd><a href="javascript:" class="changeSkin"><i
                                class="iconfont icon-huanfu"></i><cite>更换皮肤</cite></a></dd>
                        <dd><a class="signOut"><i class="iconfont icon-loginout"></i><cite>退出</cite></a></dd>
                        <!--<dd><a th:href="@{/systemLogout}" class="signOut"><i class="iconfont icon-loginout"></i><cite>退出</cite></a></dd>-->

                    </dl>
                </li>

            </ul>
        </div>
    </div>
    <div id="wrap">
        <div class="login">
            <div class="arrow-up"></div>
            <div class="formholder">
                <div class="randompad">
                    <ul class="layui-timeline" style="text-align: center" th:if="${messageListCount eq 0}  ">
                        <li class="layui-timeline-item" style="margin-top: 20px">
                            <p><span style="font-size: large;color: #bd2c00;align-items: center;">当前没有未读消息</span></p>
                        </li>
                    </ul>

                    <ul class="layui-timeline" th:each="message,status:${messageListTop}">
                        <!--<li class="layui-timeline-item" th:if="${messageListCount eq 0}  ">
                            <p><span>当前没有未读消息</span></p>
                        </li>-->
                        <!--   <li class="layui-timeline-item" th:unless="${status.count lt 1}" th:if="${messageListCount lt 1}">
                               <p><span>当前没有未读消息</span></p>
                           </li>-->
                        <li class="layui-timeline-item" th:unless="${status.count gt 2}">
                            <i class="layui-icon layui-timeline-axis"></i>
                            <div class="layui-timeline-content layui-text">
                                <h3 class="layui-timeline-title"
                                    th:text="${#dates.format(message.createDate,'yyyy-MM-dd HH:mm:ss')}"></h3>

                                <p>发件人:<span th:text="${message.fromUser.nickName}"></span></p>
                                <p>标题:<span th:text="${message.title}"></span></p>
                                <p>内容:<span th:text="${message.content}"></span></p>
                            </div>
                        </li>
                    </ul>
                    <input type="submit" value="我的消息"/>
                </div>
            </div>

        </div>
    </div>
    <!-- 左侧导航 -->
    <div class="layui-side layui-bg-black">
        <div class="user-photo">
            <a class="img" title="我的头像"><img th:src="${session.icon}"></a>
            <p>你好！<span class="userName"><shiro:principal property="nickName"/></span></p>
        </div>
        <div class="navBar layui-side-scroll"></div>
    </div>
    <!-- 右侧内容 -->
    <div class="layui-body layui-form" style="z-index: -1">
        <div class="layui-tab marg0" lay-filter="bodyTab" id="top_tabs_box">
            <ul class="layui-tab-title top_tab" id="top_tabs">
                <li class="layui-this" lay-id=""><i class="iconfont icon-computer"></i> <cite>后台首页</cite></li>
            </ul>
            <ul class="layui-nav closeBox">
                <li class="layui-nav-item">
                    <a href="javascript:"><i class="iconfont icon-caozuo"></i> 页面操作</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:" class="refresh refreshThis"><i
                                class="layui-icon layui-icon-refresh-3"></i> 刷新当前</a></dd>
                        <dd><a href="javascript:" class="closePageOther"><i class="iconfont icon-prohibit"></i> 关闭其他</a>
                        </dd>
                        <dd><a href="javascript:" class="closePageAll"><i class="iconfont icon-guanbi"></i> 关闭全部</a>
                        </dd>
                    </dl>
                </li>
            </ul>
            <div class="layui-tab-content clildFrame">
                <div class="layui-tab-item layui-show">
                    <iframe th:src="@{/admin/main}"></iframe>
                </div>
            </div>
        </div>
    </div>
    <div class=" layui-input-inline showLogout" style="display: none">
        <div>
            <div style="text-align: center;align-self: center">
                <div th:if="${currentUser.credit} ge '1'">
                    <div class="">
                        <p style="margin-top: 10px;"><i class="layui-icon" style="font-size: 50px; color: #009688;">&#xe60c;</i>
                            当前信誉值为：<span th:text="${currentUser.credit}"></span>
                        </p>
                        <p style="margin-left: 50px;margin-top: 30px">没有任何违规操作</p>
                    </div>
                </div>
                <div th:if="${currentUser.credit} lt '1'">
                    <div class=""><p style="margin-top: 10px;"><i class="layui-icon"
                                                                  style="font-size: 50px; color: #FFB800;">&#xe60c;</i>当前信誉值为：<span
                            th:text="${currentUser.credit}"></span></p>
                        <p style="margin-left: 50px;margin-top: 30px">请注意您的操作，已经有违规行为
                        </p>
                    </div>
                </div>
                <div th:if="${currentUser.credit} lt  '0.3'">
                    <div class=""><p style="margin-top: 10px;"><i class="layui-icon"
                                                                  style="font-size: 50px; color: #FF5722;">&#xe60c;</i>
                        当前信誉值为：<span th:text="${currentUser.credit}"></span></p>
                        <p style="margin-left: 50px;margin-top: 30px">信誉值太低，请联系管理员，否则下次不能访问
                        </p>
                    </div>
                </div>
            </div>
        </div>

    </div>
    <div class=" layui-input-inline showLastLoginData" style="display: none">
        <div>
            <div style="text-align: center;align-self: center">
                <div>
                    <div class="">
                        <p style="margin-top: 10px;"><i class="layui-icon" style="font-size: 50px; color: #009688;">&#xe60c;</i>
                            当前信誉值为：<span th:text="${currentUser.credit}"></span>
                        </p>
                        <p style="margin-left: 50px;margin-top: 30px">我是一条鸡汤文章</p>
                       <!-- <p style="margin-left: 50px;margin-top: 30px" th:if="${lastLoginData.unlogin}">上一次登录错误次数太多</p>
                        <p style="margin-left: 50px;margin-top: 30px" th:if="${lastLoginData.unauthorized_access}">一次没有安全退出</p>-->
                    </div>
                </div>

            </div>
        </div>

    </div>
    <!-- 底部 -->
    <div class="layui-footer footer">
        <p style="height: 0px;padding: 0px;margin-bottom: 5px;">Copyright © 2018 SAAS云管理系统 Design By Cdu大数据研究院 <a href="#" target="_self">ICP备案号
        </a></p>
        <div style="float: right" class="portAnimal">
            <i class="layui-icon portlistener layui-icon-find-fill" style="font-size: 34px;color: #009688;"></i>
            <!--<fieldset class="layui-elem-field layui-field-title" style="width: 50%;height: 50%">
                <legend>固定块</legend>
            </fieldset>-->
        </div>
    </div>
</div>
<!-- 移动导航 -->
<div class="site-tree-mobile layui-hide"><i class="layui-icon">&#xe602;</i></div>
<div class="site-mobile-shade"></div>
<script type="text/javascript">
    //循环执行，每隔1秒钟执行一次 showalert（）
    window.setInterval(function(){
        portListener();
    }, 3000);
    function portListener() {
        $.ajax({
            type:"POST",
            url:"farm/port/listener",
            dataType:"json",
            contentType:"application/json;charset=utf-8",
            data:"",
            success:function(res){
                if(res.success){
                    if(res.imageColor){
                        $(".portlistener").css("color","#ff5722");
                    }else{
                        $(".portlistener").css("color","#009688");
                    }
                    if(res.sensorError!=null){
                        var index=layer.alert(res.message, {
                            skin: 'layui-layer-molv' //样式类名
                            ,closeBtn: 1,
                             btn: ['确定']
                        }, function(){
                            layer.close(index);
                            location.href = "/index";

                        });
                    }else{
                        layer.tips(res.message, '.portlistener', {
                            time: 4000 ,
                            tips: [1, '#3595CC'],
//                        time: 4000
                        });
                    }

                }else{
                    if(res.imageColor){
                        $(".portlistener").css("color","#ff5722");
                    }else{
                        $(".portlistener").css("color","#009688");
                    }
                    return true;
                }
                return true;
            }
        });
    }
    //定时执 行，5秒后执行showalert()
  /*  window.setTimeout(function(){
        showalert("bbbb");
    },5000);*/
</script>
<script type="text/javascript" th:src="@{/static/layui/layui.js}"></script>
<script type="text/javascript" th:src="@{/static/admin/js/leftNav.js}"></script>
<script type="text/javascript" th:src="@{/static/admin/js/index.js}"></script>

</body>
</html>